Fix mingw detection