refactor premake4.lua to get ready for mingw builds