--- src/Makefile.orig	2025-06-09 12:31:15 UTC
+++ src/Makefile
@@ -122,20 +122,27 @@ export COMPILER
 endif
 export COMPILER
 
-CFLAGS += -std=gnu99 -Wall -Wextra -Werror -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS)
+# Honour/Respect User *FLAGS
+# User variables come LAST. Do NOT append to them.
 
+WARNS ?= -Wall -Wextra -Werror
+FEATS ?= -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS
+FLAGS ?= -std=gnu99 -fPIC $(WARNS) $(FEATS) -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"'
+
 ifeq ($(COMPILER),clang)
-CFLAGS += -Wno-tautological-pointer-compare
+FLAGS += -Wno-tautological-pointer-compare
 endif
 
 ifeq ($(COMPILER),gcc)
-CFLAGS += -Wno-nonnull-compare
+FLAGS += -Wno-nonnull-compare
 endif
 
 ifeq ($(PLATFORM),SunOS)
-CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
+FLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
 endif
 
+CFLAGS := $(FLAGS) $(CFLAGS)
+
 LIB_LDFLAGS += -shared
 
 LDFLAGS += $(FAKETIME_LINK_FLAGS)
@@ -143,7 +150,7 @@ endif
 LDFLAGS += -Wl,--version-script=libfaketime.map
 endif
 
-LDADD += -ldl -lm -lrt -lpthread
+LDADD += -lm -lrt -lpthread
 BIN_LDFLAGS += -lrt -lpthread
 
 SRC = libfaketime.c
