updated Makefile to support both hook and outside use