diff --git a/Makefile b/Makefile
index 6b52e0ae1c0b8c51cd9ba74e220be03aaa908be3..e4320553846661b2f4bfe0dec5576ab85aedcdd4 100644
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,10 @@ ifneq ($(wildcard makeopts),)
   include makeopts
 endif
 
+# Some build systems, such as the one in openwrt, like to pass custom target
+# CFLAGS in the COPTS variable.
+ASTCFLAGS+=$(COPTS)
+
 #Uncomment this to see all build commands instead of 'quiet' output
 #NOISY_BUILD=yes