Fix building with MSYS and MinGW(-w64); Improve Makefile.lite build system