update Makefile for external build and install