add some tweaks for building with crossroad and mingw-w64