The enemy of my enenmy is my friend? So who's the ally?
At the end of the day Al Qaeda are terrorists, whihc means they are criminals, as are pirates. This is simply a case of crime families muscling in on each other, the main problem being that it is happening so far away; geographically speaking, from the concerned parties. So nothing will happen until one or the other is firmly entrenched and we in the West will continue to wring our hands and bemoan the fact that poor people around the world do not understand that we're doing our best for them and they must not support people who are antithetical to our beliefs, even if they bring hard currency and prosperity to the local area.