Makefile: compile function, g++ pedantic mode, etc
Further makefile cleanup