Index: wavemon-0.4.0b/Makefile.in
===================================================================
--- wavemon-0.4.0b.orig/Makefile.in	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/Makefile.in	2007-07-10 16:33:08.000000000 +0200
@@ -8,13 +8,14 @@
 LIBS = @LIBS@
 
 CFLAGS = @CFLAGS@
+LDFLAGS= @LDFLAGS@
 
 OBJECTS = conf.o llist.o ui.o error.o timer.o info_scr.o lhist_scr.o aplst_scr.o conf_scr.o help_scr.o about_scr.o iw_if.o net_if.o
 
 all: wavemon
 
 wavemon: wavemon.o $(OBJECTS)
-	$(CC) $(CFLAGS) $(LIBS) -o wavemon wavemon.o $(OBJECTS)
+	$(CC) $(LDFLAGS) $(LIBS) -o wavemon wavemon.o $(OBJECTS)
 
 wavemon.o: wavemon.c defs.h $(OBJECTS)
 
Index: wavemon-0.4.0b/configure
===================================================================
--- wavemon-0.4.0b.orig/configure	2007-07-10 16:33:06.000000000 +0200
+++ wavemon-0.4.0b/configure	2007-07-10 16:33:08.000000000 +0200
@@ -544,14 +544,14 @@
 EOF
 
 
-CFLAGS="-O2 -Wall"
+CFLAGS="$CFLAGS -O2 -Wall"
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
   
 		if test x$enableval = xyes ; then
-			CFLAGS="-O -Wall -g -DDEBUG"
+			CFLAGS="$CFLAGS -g -DDEBUG"
 		fi
 	
 
Index: wavemon-0.4.0b/configure.in
===================================================================
--- wavemon-0.4.0b.orig/configure.in	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/configure.in	2007-07-10 16:33:08.000000000 +0200
@@ -13,12 +13,12 @@
 
 AC_DEFINE_UNQUOTED(WAVEMON_VERSION_STR, "version ${WAVEMON_VERSION} (${WAVEMON_RELEASE_DATE})")
 
-CFLAGS="-O2 -Wall"
+CFLAGS="$CFLAGS -O2 -Wall"
 
 AC_ARG_ENABLE(debug, [  --enable-debug             Enable debugging support],
 	[
 		if test x$enableval = xyes ; then
-			CFLAGS="-O -Wall -g -DDEBUG"
+			CFLAGS="$CFLAGS -g -DDEBUG"
 		fi
 	]
 )
Index: wavemon-0.4.0b/error.c
===================================================================
--- wavemon-0.4.0b.orig/error.c	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/error.c	2007-07-10 16:33:08.000000000 +0200
@@ -19,6 +19,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <stdarg.h>
 #include <ncurses.h>
 #include "conf.h"
Index: wavemon-0.4.0b/Makefile.in
===================================================================
--- wavemon-0.4.0b.orig/Makefile.in	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/Makefile.in	2007-07-10 16:33:08.000000000 +0200
@@ -8,13 +8,14 @@
 LIBS = @LIBS@
 
 CFLAGS = @CFLAGS@
+LDFLAGS= @LDFLAGS@
 
 OBJECTS = conf.o llist.o ui.o error.o timer.o info_scr.o lhist_scr.o aplst_scr.o conf_scr.o help_scr.o about_scr.o iw_if.o net_if.o
 
 all: wavemon
 
 wavemon: wavemon.o $(OBJECTS)
-	$(CC) $(CFLAGS) $(LIBS) -o wavemon wavemon.o $(OBJECTS)
+	$(CC) $(LDFLAGS) $(LIBS) -o wavemon wavemon.o $(OBJECTS)
 
 wavemon.o: wavemon.c defs.h $(OBJECTS)
 
Index: wavemon-0.4.0b/configure
===================================================================
--- wavemon-0.4.0b.orig/configure	2007-07-10 16:33:06.000000000 +0200
+++ wavemon-0.4.0b/configure	2007-07-10 16:33:08.000000000 +0200
@@ -544,14 +544,14 @@
 EOF
 
 
-CFLAGS="-O2 -Wall"
+CFLAGS="$CFLAGS -O2 -Wall"
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
   
 		if test x$enableval = xyes ; then
-			CFLAGS="-O -Wall -g -DDEBUG"
+			CFLAGS="$CFLAGS -g -DDEBUG"
 		fi
 	
 
Index: wavemon-0.4.0b/configure.in
===================================================================
--- wavemon-0.4.0b.orig/configure.in	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/configure.in	2007-07-10 16:33:08.000000000 +0200
@@ -13,12 +13,12 @@
 
 AC_DEFINE_UNQUOTED(WAVEMON_VERSION_STR, "version ${WAVEMON_VERSION} (${WAVEMON_RELEASE_DATE})")
 
-CFLAGS="-O2 -Wall"
+CFLAGS="$CFLAGS -O2 -Wall"
 
 AC_ARG_ENABLE(debug, [  --enable-debug             Enable debugging support],
 	[
 		if test x$enableval = xyes ; then
-			CFLAGS="-O -Wall -g -DDEBUG"
+			CFLAGS="$CFLAGS -g -DDEBUG"
 		fi
 	]
 )
Index: wavemon-0.4.0b/error.c
===================================================================
--- wavemon-0.4.0b.orig/error.c	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/error.c	2007-07-10 16:33:08.000000000 +0200
@@ -19,6 +19,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <stdarg.h>
 #include <ncurses.h>
 #include "conf.h"
Index: wavemon-0.4.0b/Makefile.in
===================================================================
--- wavemon-0.4.0b.orig/Makefile.in	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/Makefile.in	2007-07-10 16:33:08.000000000 +0200
@@ -8,13 +8,14 @@
 LIBS = @LIBS@
 
 CFLAGS = @CFLAGS@
+LDFLAGS= @LDFLAGS@
 
 OBJECTS = conf.o llist.o ui.o error.o timer.o info_scr.o lhist_scr.o aplst_scr.o conf_scr.o help_scr.o about_scr.o iw_if.o net_if.o
 
 all: wavemon
 
 wavemon: wavemon.o $(OBJECTS)
-	$(CC) $(CFLAGS) $(LIBS) -o wavemon wavemon.o $(OBJECTS)
+	$(CC) $(LDFLAGS) $(LIBS) -o wavemon wavemon.o $(OBJECTS)
 
 wavemon.o: wavemon.c defs.h $(OBJECTS)
 
Index: wavemon-0.4.0b/configure
===================================================================
--- wavemon-0.4.0b.orig/configure	2007-07-10 16:33:06.000000000 +0200
+++ wavemon-0.4.0b/configure	2007-07-10 16:33:08.000000000 +0200
@@ -544,14 +544,14 @@
 EOF
 
 
-CFLAGS="-O2 -Wall"
+CFLAGS="$CFLAGS -O2 -Wall"
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval="$enable_debug"
   
 		if test x$enableval = xyes ; then
-			CFLAGS="-O -Wall -g -DDEBUG"
+			CFLAGS="$CFLAGS -g -DDEBUG"
 		fi
 	
 
Index: wavemon-0.4.0b/configure.in
===================================================================
--- wavemon-0.4.0b.orig/configure.in	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/configure.in	2007-07-10 16:33:08.000000000 +0200
@@ -13,12 +13,12 @@
 
 AC_DEFINE_UNQUOTED(WAVEMON_VERSION_STR, "version ${WAVEMON_VERSION} (${WAVEMON_RELEASE_DATE})")
 
-CFLAGS="-O2 -Wall"
+CFLAGS="$CFLAGS -O2 -Wall"
 
 AC_ARG_ENABLE(debug, [  --enable-debug             Enable debugging support],
 	[
 		if test x$enableval = xyes ; then
-			CFLAGS="-O -Wall -g -DDEBUG"
+			CFLAGS="$CFLAGS -g -DDEBUG"
 		fi
 	]
 )
Index: wavemon-0.4.0b/error.c
===================================================================
--- wavemon-0.4.0b.orig/error.c	2007-07-10 16:33:07.000000000 +0200
+++ wavemon-0.4.0b/error.c	2007-07-10 16:33:08.000000000 +0200
@@ -19,6 +19,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <stdarg.h>
 #include <ncurses.h>
 #include "conf.h"
