diff --git a/makefile b/makefile
index eb71bba..b96b2ba 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,7 @@
 #--------------------------------
 # jhead makefile for Unix
 #--------------------------------
-PREFIX=$(DESTDIR)/usr/local
+PREFIX?=$(DESTDIR)/usr/local
 BINDIR=$(PREFIX)/bin
 DOCDIR=$(PREFIX)/share/doc/jhead
 MANDIR=$(PREFIX)/share/man/man1
@@ -10,8 +10,8 @@ SRC=.
 
 DPKG_BUILDFLAGS := $(shell command -v dpkg-buildflags 2> /dev/null)
 ifdef DPKG_BUILDFLAGS
-CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
-LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+CFLAGS?=$(shell dpkg-buildflags --get CFLAGS)
+LDFLAGS?=$(shell dpkg-buildflags --get LDFLAGS)
 endif
 
 # To enable electric fence, set ELECTRIC_FENCE=1
