--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,10 @@
 endif
 GIT_COMMIT = $(shell git rev-parse --short HEAD)
 
-CFLAGS = -DNDEBUG -O2 -Wall -Wextra -fno-strict-aliasing
-override CFLAGS += $(shell curl-config --cflags) $(shell xml2-config --cflags)
+CFLAGS += -DNDEBUG -Wall -Wextra -fno-strict-aliasing
+override CFLAGS += $(shell sh @TERMUX_PREFIX@/bin/curl-config --cflags) $(shell sh @TERMUX_PREFIX@/bin/xml2-config --cflags)
 
-LDLIBS = $(shell curl-config --libs) $(shell xml2-config --libs) -lm
+LDLIBS = $(shell sh @TERMUX_PREFIX@/bin/curl-config --libs) $(shell sh @TERMUX_PREFIX@/bin/xml2-config --libs) -lm
 ifeq ($(SYSTEM), Linux)
 	LDLIBS += -lseccomp
 else ifeq ($(SYSTEM), FreeBSD)
