mingw fixes, now project builds with mingw64 and -DUSE_PREBUILT_LIBS=NO (some additional libs hardcoded still)