Improve portability of the Makefile

Tested with GNU Make and PMake.