There are 2 options with dealing with Shabaab;
The first approach is to just bring them to the table and try to negotiate a ceasefire, with Shabaab becoming somewhat similar to the Muslim Brotherhood overtime, with them having strong links to politicians and having a military wing.
The second approach is similar to what Alvaro Uribe did in Colombia against the communist militia FARC, which is the Somali government using a massive amount of violence in crackdowns against Shabaab and anyone affiliated with them. This would cause for thousands and thousands of people to die, with a lot of them being innocent. But the goal is just to cull their numbers no matter what until they don't pose a threat.