When guns are not available through licit and illicit sources, people improvise. Guns are actually pretty simple machines. And full-auto guns are simpler and less complicated than semi-auto weapons.
It should come as no surprise then that when people decide to cobble together a gun in their basement or garage, it is usually a sub-machinegun. Easy peasy.
Here are some: <http://www.thefirearmblog.com/blog/2014/01/22/common-illicitly-homemade-submachine-guns-brazil/>