link fix and makefile improvements