Fix compiling with mingw, add a makefile