fixes for building with mingw
check for building with mingw