fix makefile, add correct linked library and delete unused variable