--- a/linux/Makefile
+++ b/linux/Makefile
@@ -9,22 +9,22 @@
 LIBVERSION      = $(shell .  $(CURDIR)/../lib/shlib_version; echo $$major.$$minor)
 LIBMAJORVERSION = $(shell .  $(CURDIR)/../lib/shlib_version; echo $$major)
 
-MAINT_CFLAGS   = -std=c99 -Wmissing-prototypes -Wall -Wextra -Wshadow -Wno-uninitialized -g
-MAINT_LDFLAGS  = -Wl,--as-needed
+MAINT_CFLAGS   = -std=c99 -Wmissing-prototypes -Wall -Wextra -Wshadow -Wno-uninitialized
+MAINT_LDFLAGS  = 
 MAINT_CPPFLAGS = -I. -D_GNU_SOURCE -DSWM_LIB=\"$(LIBDIR)/libswmhack.so.$(LIBVERSION)\"
 
 ifneq ("${BUILDVERSION}", "")
 MAINT_CPPFLAGS += -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
 endif
 
-BIN_CFLAGS   = -fPIE
-BIN_LDFLAGS  = -fPIE -pie
-BIN_CPPFLAGS = $(shell pkg-config --cflags x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
-BIN_LDLIBS   = $(shell pkg-config --libs   x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
+BIN_CFLAGS   = 
+BIN_LDFLAGS  = 
+BIN_CPPFLAGS = $(shell $(PKG_CONFIG) --cflags x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
+BIN_LDLIBS   = $(shell $(PKG_CONFIG) --libs   x11 x11-xcb xcb-icccm xcb-keysyms xcb-randr xcb-util xcb-xinput xcb-xtest xcursor xft)
 LIB_CFLAGS   = -fPIC
 LIB_LDFLAGS  = -fPIC -shared
-LIB_CPPFLAGS = $(shell pkg-config --cflags x11)
-LIB_LDLIBS   = $(shell pkg-config --libs   x11) -ldl
+LIB_CPPFLAGS = $(shell $(PKG_CONFIG) --cflags x11)
+LIB_LDLIBS   = $(shell $(PKG_CONFIG) --libs   x11) -ldl
 
 all: spectrwm libswmhack.so.$(LIBVERSION)
 
