minor fixes and makefile improvements