diff --git a/src/doc/Makefile b/src/doc/Makefile
index 17510caebd1f34ed6dc0bc19108cb41fa730de76..7f5c3d5ec0d0bf6ae06d1ddd3ae6386aa3732ae2 100644
--- a/src/doc/Makefile
+++ b/src/doc/Makefile
@@ -24,16 +24,15 @@
 # It is based upon the autocreated makefile for Sphinx documentation.
 
 # You can set these variables from the command line, and also
-# from the environment for the first two.
+# from the environment for the first four.
 SPHINXOPTS    ?= -a
 SPHINXBUILD   ?= sphinx-build
+NPM_PREFIX ?= ../..
+JSDOC_BIN ?= jsdoc
 # SPHINXAPIDOC  ?= javasphinx-apidoc
 SOURCEDIR      = .
 BUILDDIR       = ../../build/doc
 
-# npm is not always in the global PATH
-NPM_PATH = $(shell npm bin)
-NPM_PREFIX = $(shell npm prefix)
 
 .PHONY: doc-help Makefile api
 
@@ -44,8 +43,8 @@ doc-help:
 # Catch-all target: route all unknown targets to Sphinx using the new
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
 %: Makefile api
-	PATH=$(NPM_PATH):$$PATH $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+	$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
 #	sphinx-build -M html . ../../build/doc
 
 api:
-	PATH=$(NPM_PATH):$$PATH jsdoc -t $(NPM_PREFIX)/node_modules/jsdoc-sphinx/template -d $@ -r "../../src/core"
+	$(JSDOC_BIN) -t $(NPM_PREFIX)/node_modules/@indiscale/jsdoc-sphinx/template -d $@ -r "../../src/core"