Organizations such as AQM have so much support and capability that local governments are often afraid to oppose them directly for fear that things will escalate and they'll lose the entire country. This often presents logistical challenges for US forces.
American forces are working on multiple levels and approaches not just "direct action".
It's not just about Somalia. Somalia is the poster child and gets the most press but really a drop in the bucket. Africa is a big continent with systemic challenges and those challenges are the perfect power vacuum for these groups.
We've been there since before 9/11. It's an ooooold fight.