-JSTEST ?= node_modules/.bin/jstest
-JSHINT ?= node_modules/.bin/jshint
-UGLIFY ?= node_modules/.bin/uglifyjs
-SOURCES = string-lerp.js
+PKGNAME := string-lerp
+
+fallback = $(firstword $(shell command -v $(1)) $(2))
+
+git = $(shell GIT_DIR=$(firstword $(2) $(srcdir) .)/.git $(GIT) $(1))
+git_ls-tree = $(call git,ls-tree -r --name-only $(1),$(2))
+git_tag = $(call git,name-rev --tags --name-only $(call git,rev-parse $(1),$(2)),$(2))
+
+GIT ?= git
+NPM ?= npm
+NPMBINDIR := ./node_modules/.bin
+JSTEST ?= $(NPMBINDIR)/jstest
+JSHINT ?= $(call fallback,jshint,$(NPMBINDIR)/jshint)
+UGLIFY ?= $(call fallback,uglifyjs,$(NPMBINDIR)/uglifyjs)
+SOURCES := string-lerp.js