A dysfunctional legal market leads black markets to flourish, as miners need some way to sell their goods, and traders want to profit exporting the gold to foreign countries. This leads to extralegal organizations, like criminal syndicates and mafias, forming to protect illegal producers and connect them to external markets.
And so, to fix this, African countries need to not only crack down on illegal exports but also make it easier for legal entities to enter the industry. The government needs to provide a safe business environment for legal producers. That will cause illegal producers to naturally decline, as efficient legal production will lower costs.
Of course, this is easier said than done. Structural reform of corrupt kleptocracies is incredibly difficult. But without top-down reform, restricting illegal exports will accomplish very little beyond worsening poverty.