Al Qaeda is only as powerful and influential as it is today because its roots began at receiving US support and training from our military. We're solving the problem of having militias trained by the US going rogue, by training more vague elements who we hope don't turn out the same way. It doesn't seem very efficient to me.
Al-Qaeda has it's roots in Op Cyclone to utilize local elements to resist Soviet invasion. it was obviously encouraged to not necessarily be anti-US. it rose to prominence with radicalization during the Gulf War, of which i have some first hand experience. the involvement of the US in Iraq and Kuwait was a turning point that began anti-US sentiment. it is a mistake to assume that, barring a crystal ball or a policy of isolation, merely training current allies will always lead to problems in the future. unlike Al Qaeda, we are training organized government forces; not convenient mujahedin.
That is because the USA has strict immigration controls, unlike Europe currently. While Africans flood into Europe and don't integrate, I would say that the average African does not integrate well into European or North American society. Just because the very few that did come to the USA have integrated somewhat, does not mean that it's the same for the vast majority of Africans.
the majority of immigrants into Europe are either compatible (South African, for example) or are from former colonies that have history together (Tunisia, Morroco, Algeria). you'll notice that most of these are North African rather than not - this is an important distinction as North Africa is majority Muslim and in some places is open to radicalization much more readily than other parts of Africa where ethnic violence is much more common than any significant difference in religious or political outlooks.
What is stopping the groups the USA is currently training from becoming extremists? What's stopping this Niger army from becoming the next Boko Haram after Boko Haram is taken out?
the quality of training, and the array of forces against it as well as the stability of the government that mustered the army. once again, there is no magic crystal ball that can detect if whoever we are training will radicalize to attack us later. we can only use the information we have at the present to work with and hope to stem the spread of radicalization that we know of.
The instability of these countries are caused by one thing: violent mentalities and scarcity.
once again, you oversimplify things. in many locations, ethnic tensions are very high because of their long histories of warfare against each other, on top of colonialism introducing significant class disparities that have been grossly magnified over the centuries. Africa has always been a war-torn place, just as much as Europe has been, but whereas Europe has a strong backing of ethnic homogeneity, Africa does not. it is not simply a "violent mentality" problem. violence is a solution to a problem they perceive in the way the world is and that violence is encouraged by both their own culture and their government. in some ways it is self perpetuating, but ultimately to guide it along more constructive routes intervention is needed. already many
many parts of Africa have calmed down. regional warlords are losing ground and men to successful, stable governments and states that people migrate to because farming and industry is more profitable and viable than scratching out a living in the sticks where your neighbors could raid your village for its livestock.
once again, i encourage you to read up a bit more on the continent and its history, as well as the current political climate among the states and actors there. it's quite interesting, really.