More portable Makefile

Fix #512 (thx to @avsm)