That's exactly what they did in Iraq. If you look at the history of South Korea, after the ceasefire, it's assassinations, coups and violent protests up until around 1990 when its society stabilized. Today South Korea is a high-tech, economic powerhouse, ranking 7th in the world in exports at $552.7 billion in 2012. This includes products like semiconductors, wireless telecommunications equipment, motor vehicles, computers, steel, ships, and petro chemicals.
My point is that some Third World allies are worth investing in. Afghanistan may not be holding on to but in my opinion Iraq probably is.