A COSTLY strike by carworkers in South Africa was at last called off on October 6th. The production lost to the dispute cannot easily be made up as car plants often work around the clock. Worse, the country’s reputation as a place for foreign investment has suffered. BMW, a big German carmaker, says the damage caused by the strike will influence the company’sfuture investment plans.

That sobering statement came just days after the IMF’s anual health-check on the economy. It is a portrait of a country that increasingly relies on foreign creditors to plug the holes in its finances yet does little to ensure that this much-needed investment will keep flowing.

The IMF’s judgment could scarcely be more damning. The report says that South Africa’s economy has grown far more slowly than its peers. The misery in Europe, where a big chunk of South Africa’s exports usually go, has not helped. But it does not excuse troubles at home: “Although weak trading-partner growth contributed, domestic factors were an important reason why South Africa’s growth has been below that of other emerging markets,” the report notes.

It might beggar belief that carworkers can strike for big wage increases when South Africa’s economy is growing so slowly and its unemployment rate is a depressing 25%. Yet the crux of the country’s economic difficulties is an “insider-outsider” complex, says the IMF, which affects both jobs and goods markets. It is costly to fire workers even with good reason. The protections afforded to insiders with jobs leave employers less willing to hire in case they turn out to be work-shy or incompetent. Meanwhile outsiders, mostly the young, are locked out of work.

Business in South Africa is part of the racket. It feigns to loathe costly regulations but in fact red tape makes it harder for job-creating start-ups to challenge established businesses. The IMF notes that the rate of creation and survival of new companies is one of the lowest in the world. This is a sweet deal for incumbent firms, which are more profitable in South Africa than their peers in many emerging markets, including Brazil, China, India and Russia. The lack of competition imposes an additional cost (over forgone jobs) on poor households in the form of high prices.

The social problems related to joblessness are reason enough to shake things up. But reform is even more urgent because of South Africa’s reliance on the kindness of strangers. It runs a current-account deficit of more than 6% of GDP: this is how much it adds to its overdraft with foreigners each year. It would better if this was funded by foreign direct investment, the sort of long-term capital that a BMW plant represents. But the gap between what South Africa spends and what it earns has been bridged by foreign buying of government bonds. The proceeds have gone on public-sector wages rather than on infrastructure projects, such as roads, ports and power plants.

Such purchases cannot be relied on for ever. Interest rates will eventually return to more normal levels in America and Europe. When that happens, capital will flow less freely to emerging markets, such as South Africa. And foreign investors might take fright sooner than that. In the rush for the exits, long-term interest rates would rise and the currency would wilt, leaving the economy in even deeper trouble.