tweaks for MinGW optimized build to correcly run