Various fixes to makefile and installation script