fix MinGW detection in Makefiles