fixes to mingw build enviroment