--- a/netsurf-2.9/framebuffer/Makefile.target
+++ b/netsurf-2.9/framebuffer/Makefile.target
@@ -2,6 +2,24 @@
 # Framebuffer target setup
 # ----------------------------------------------------------------------------
 
+ifeq ($(HOST),mint)
+    # freemint does not support pkg-config for libcurl
+    CFLAGS += $(shell curl-config --cflags)
+
+    LDFLAGS += $(shell curl-config --libs)
+    LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
+    # xml-config returns -lsocket which is not needed and does not
+    # exist on all systems.  because of that - hardcoded reference to
+    # libxml-2.0 here.
+    LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv 
+    LDFLAGS += -lm
+else
+    CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
+
+    LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub openssl)
+    LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
+endif
+
 
 $(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
 $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng)  ))
@@ -49,24 +67,6 @@
 
 LDFLAGS += -lm -Wl,--whole-archive $(shell $(PKG_CONFIG) --libs libnsfb) -Wl,--no-whole-archive 
 
-ifeq ($(HOST),mint)
-    # freemint does not support pkg-config for libcurl
-    CFLAGS += $(shell curl-config --cflags)
-
-    LDFLAGS += $(shell curl-config --libs)
-    LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
-    # xml-config returns -lsocket which is not needed and does not
-    # exist on all systems.  because of that - hardcoded reference to
-    # libxml-2.0 here.
-    LDFLAGS += -L/usr/lib/ -lxml2 -lz -liconv 
-    LDFLAGS += -lm
-else
-    CFLAGS += $(shell $(PKG_CONFIG) --cflags libcurl)
-
-    LDFLAGS += $(shell $(PKG_CONFIG) --libs libxml-2.0 libcurl libhubbub openssl)
-    LDFLAGS += $(shell $(PKG_CONFIG) --libs libcss)
-endif
-
 
 # ----------------------------------------------------------------------------
 # built-in resource setup
