--- Makefile.orig	2015-12-20 07:21:25.000000000 -0500
+++ Makefile	2016-12-26 17:24:03.031882664 -0500
@@ -11,12 +11,15 @@
 
 # optional dependencies:
 # giflib: gif animations
+ifeq ($(WITH_GIFLIB), 1)
 	CPPFLAGS += -DHAVE_GIFLIB
 	LIBS     += -lgif
+endif
 # libexif: jpeg auto-orientation, exif thumbnails
+ifeq ($(WITH_LIBEXIF), 1)
 	CPPFLAGS += -DHAVE_LIBEXIF
 	LIBS     += -lexif
-
+endif
 
 .PHONY: clean install uninstall
 
