diff -urN a/libbio/Makefile b/libbio/Makefile
--- a/libbio/Makefile	2011-01-02 21:52:49.000000000 +0100
+++ b/libbio/Makefile	2016-01-08 12:18:18.412351802 +0100
@@ -52,12 +52,12 @@
 all: $(LIB)
 
 install: $(LIB)
-	mkdir -p $(PREFIX)/share/man/man3
-	install -m 0644 bio.3 $(PREFIX)/share/man/man3/bio.3
-	mkdir -p $(PREFIX)/include
-	install -m 0644 bio.h $(PREFIX)/include
-	mkdir -p $(PREFIX)/lib
-	install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
+	mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3
+	install -m 0644 bio.3 $(DESTDIR)$(PREFIX)/share/man/man3/bio.3
+	mkdir -p $(DESTDIR)$(PREFIX)/include
+	install -m 0644 bio.h $(DESTDIR)$(PREFIX)/include
+	mkdir -p $(DESTDIR)$(PREFIX)/lib
+	install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB)
 
 bcat: bcat.$O $(LIB)
 	$(CC) -o bcat bcat.$O $(LIB) -L/usr/local/lib -lfmt -lutf
diff -urN a/libfmt/Makefile b/libfmt/Makefile
--- a/libfmt/Makefile	2011-01-02 21:52:49.000000000 +0100
+++ b/libfmt/Makefile	2016-01-08 12:18:18.412351802 +0100
@@ -76,13 +76,13 @@
 all: $(LIB)
 
 install: $(LIB)
-	test -d $(PREFIX)/share/man/man3 || mkdir -p $(PREFIX)/share/man/man3
-	install -m 0644 print.3 $(PREFIX)/share/man/man3/print.3
-	install -m 0644 fmtinstall.3 $(PREFIX)/share/man/man3/fmtinstall.3
-	mkdir -p $(PREFIX)/include
-	install -m 0644 fmt.h $(PREFIX)/include/fmt.h
-	mkdir -p $(PREFIX)/lib
-	install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
+	test -d $(DESTDIR)$(PREFIX)/share/man/man3 || mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3
+	install -m 0644 print.3 $(DESTDIR)$(PREFIX)/share/man/man3/print.3
+	install -m 0644 fmtinstall.3 $(DESTDIR)$(PREFIX)/share/man/man3/fmtinstall.3
+	mkdir -p $(DESTDIR)$(PREFIX)/include
+	install -m 0644 fmt.h $(DESTDIR)$(PREFIX)/include/fmt.h
+	mkdir -p $(DESTDIR)$(PREFIX)/lib
+	install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB)
 
 $(NAN).$O: nan.h
 strtod.$O: nan.h
diff -urN a/libregexp/Makefile b/libregexp/Makefile
--- a/libregexp/Makefile	2011-01-02 21:52:49.000000000 +0100
+++ b/libregexp/Makefile	2016-01-08 12:18:18.412351802 +0100
@@ -43,13 +43,13 @@
 all: $(LIB)
 
 install: $(LIB)
-	mkdir -p $(PREFIX)/share/man/man3 $(PREFIX)/man/man7
-	install -m 0644 regexp9.3 $(PREFIX)/share/man/man3/regexp9.3
-	install -m 0644 regexp9.7 $(PREFIX)/man/man7/regexp9.7
-	mkdir -p $(PREFIX)/lib
-	install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
-	mkdir -p $(PREFIX)/include
-	install -m 0644 regexp9.h $(PREFIX)/include/regexp9.h
+	mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/man/man7
+	install -m 0644 regexp9.3 $(DESTDIR)$(PREFIX)/share/man/man3/regexp9.3
+	install -m 0644 regexp9.7 $(DESTDIR)$(PREFIX)/man/man7/regexp9.7
+	mkdir -p $(DESTDIR)$(PREFIX)/lib
+	install -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB)
+	mkdir -p $(DESTDIR)$(PREFIX)/include
+	install -m 0644 regexp9.h $(DESTDIR)$(PREFIX)/include/regexp9.h
 
 test: test.$O $(LIB)
 	$(CC) -o test test.$O $(LIB) -L/usr/local/lib -lfmt -lutf
diff -urN a/libutf/Makefile b/libutf/Makefile
--- a/libutf/Makefile	2011-01-02 21:52:48.000000000 +0100
+++ b/libutf/Makefile	2016-01-08 12:18:18.412351802 +0100
@@ -55,15 +55,15 @@
 all: $(LIB)
 
 install: $(LIB)
-	mkdir -p $(PREFIX)/share/man/man3 $(PREFIX)/man/man7
-	install -c -m 0644 isalpharune.3 $(PREFIX)/share/man/man3/isalpharune.3
-	install -c -m 0644 utf.7 $(PREFIX)/man/man7/utf.7
-	install -c -m 0644 rune.3 $(PREFIX)/share/man/man3/rune.3
-	install -c -m 0644 runestrcat.3 $(PREFIX)/share/man/man3/runestrcat.3
-	mkdir -p $(PREFIX)/include
-	install -c -m 0644 utf.h $(PREFIX)/include/utf.h
-	mkdir -p $(PREFIX)/lib
-	install -c -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
+	mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/man/man7
+	install -c -m 0644 isalpharune.3 $(DESTDIR)$(PREFIX)/share/man/man3/isalpharune.3
+	install -c -m 0644 utf.7 $(DESTDIR)$(PREFIX)/man/man7/utf.7
+	install -c -m 0644 rune.3 $(DESTDIR)$(PREFIX)/share/man/man3/rune.3
+	install -c -m 0644 runestrcat.3 $(DESTDIR)$(PREFIX)/share/man/man3/runestrcat.3
+	mkdir -p $(DESTDIR)$(PREFIX)/include
+	install -c -m 0644 utf.h $(DESTDIR)$(PREFIX)/include/utf.h
+	mkdir -p $(DESTDIR)$(PREFIX)/lib
+	install -c -m 0644 $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB)
 
 $(LIB): $(OFILES)
 	$(AR) $(ARFLAGS) $(LIB) $(OFILES)
diff -urN a/mk/Makefile b/mk/Makefile
--- a/mk/Makefile	2011-01-02 21:52:50.000000000 +0100
+++ b/mk/Makefile	2016-01-08 12:18:18.412351802 +0100
@@ -63,13 +63,13 @@
 TGZFILES+=mk.pdf
 
 install: $(TARG)
-	mkdir -p $(PREFIX)/bin
-	install -m 0755 mk $(PREFIX)/bin/mk
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	install -m 0755 mk $(DESTDIR)$(PREFIX)/bin/mk
 	cat mk.1 | sed 's;DOCPREFIX;$(PREFIX);g' >mk.1a
-	mkdir -p $(PREFIX)/man/man1
-	install -m 0644 mk.1a $(PREFIX)/man/man1/mk.1
-	mkdir -p $(PREFIX)/doc
-	install -m 0644 mk.pdf $(PREFIX)/doc/mk.pdf
+	mkdir -p $(DESTDIR)$(PREFIX)/man/man1
+	install -m 0644 mk.1a $(DESTDIR)$(PREFIX)/man/man1/mk.1
+	mkdir -p $(DESTDIR)$(PREFIX)/doc
+	install -m 0644 mk.pdf $(DESTDIR)$(PREFIX)/doc/mk.pdf
 
 $(LIB): $(OFILES)
 	$(AR) $(ARFLAGS) $(LIB) $(OFILES)
