added makefile
portability improvements