Modifications to allow crosscompiling with mingw