To my knowledge (I am not an expert) it is relatively easy to make an open bolt submachine gun that will fire as long as the trigger is held down, but this isn't the safest design. You can apparently do it on some modern guns simply by filing the sear enough, but it's not a reliable method of fire and people have died that way.
I've thought before about building a STEN semi auto clone, but in the US they're also required to shoot from a closed bolt, and apparently they're had to manufacture that way.
I do have to talk again about pertinent laws. I'm not sure if you live somewhere outside of the US where this is legal or plan to go somewhere that it is, but it's not even easy for an SOT to make the kind of stuff you're talking about, and it is concerning when you start talking about the cheapest way to do it, irrespective of local laws, especially when you start insisting that you wouldn't do anything of the sort because you're a decent Christian American citizen. It does have a very ATF undercover agent vibe to it, if you know what I'm seeing. Regardless, we have to put all of these disclaimers out there because this will be searchable for forever and an age from now (I regularly pull up 15 year old TFL threads in my google searches) and people reading this then may not be able to ask questions about it.
All of that said, if the question we're asking is entirely academic, I have to imagine that a person with machining experience and access to a lathe, mill, dremel, and standard power tools could create a smoothbore, open bolt 9mm sub gun for around $100-$150 in parts. It wouldn't be pretty, accurate, and maybe not even reliable or safe, but it would dump ammo. That was exactly the idea behind the STEN, which could be made by resistance forces in machine shops in basements even with unsteady access to a power supply.
Other than black market trade in parts of the world where they can be obtained cheap, that would seem to me to be the cheapest way to create a machine gun if you weren't worried about any factor besides making it dump bullets. That or modifying certain existing firearms. Giving too much more information than that is probably not good etiquette on a forum like this - the information is out there and not illegal to have if you really cared, but could be shown as evidence that one planned to build a machine gun if you have certain parts to do it with and live in a country where they are illegal or restrictive (almost the entire world at this point)