Added Makefile / compat fixes for gcc and mingw32