diff --git a/Makefile b/Makefile
index 1d2f43d..7a324ef 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,7 @@ install: all
@cp -f lsw ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/lsw
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1/lsw.1
+ @mkdir -p ${DESTDIR}${MANPREFIX}/man1
@sed "s/VERSION/${VERSION}/g" < lsw.1 > ${DESTDIR}${MANPREFIX}/man1/lsw.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/lsw.1
diff --git a/config.mk b/config.mk
index 0383aa9..725d488 100644
--- a/config.mk
+++ b/config.mk
@@ -2,7 +2,7 @@
VERSION = 0.2
# paths
-PREFIX = /usr/local
+PREFIX?= /usr/local
MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include
@@ -14,8 +14,8 @@ LIBS = -L${X11LIB} -lX11
# flags
CPPFLAGS = -DVERSION=\"${VERSION}\"
-CFLAGS = -ansi -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
-LDFLAGS = -s ${LIBS}
+CFLAGS = ${RPM_OPT_FLAGS} ${INCS} ${CPPFLAGS}
+LDFLAGS = ${LIBS}
# compiler and linker
CC = cc