How can I build it to also generate the required dll’s?
Definitely builds lua51.dll (a result of make mingw in src directory definitely has that and lua.exe). So perhaps an install issue?
There's definitely a bug in that makefile (5.1.5) because it really doesn't like that # comment when building lua51.dll. (But I remember this has already been reported)