diff -ur ../dynamips-0.2.7.orig/Makefile ./Makefile
--- ../dynamips-0.2.7.orig/Makefile	2007-09-01 12:42:48.000000000 -0400
+++ ./Makefile	2007-09-01 13:28:37.000000000 -0400
@@ -20,7 +20,6 @@
 VERSION_DEV=$(VERSION_TRAIN)-$(shell date +%Y%m%d-%H)
 
 # Executable binary extension
-DESTDIR?=/usr
 BIN_EXT?=
 
 CC?=gcc
@@ -40,45 +39,15 @@
 	-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE \
 	-DHAS_RFC2553=$(HAS_RFC2553)
 
-PCAP_LIB=/usr/local/lib/libpcap.a
+PCAP_LIB=-lpcap
 #PCAP_LIB=-lpcap
 
-ifeq ($(shell uname), FreeBSD)
-   PTHREAD_LIBS?=-pthread
-   CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf $(PTHREAD_CFLAGS) \
-         -D_FILE_OFFSET_BITS=64
-   LIBS=-L/usr/local/lib -L. -lelf $(PTHREAD_LIBS)
-else
-ifeq ($(shell uname), Linux)
-   PTHREAD_LIBS?=-lpthread
-#   PCAP_LIB=-lpcap
-   CFLAGS+=-I/usr/include -I. $(PTHREAD_CFLAGS)
-   LIBS=-L/usr/lib -L. /usr/lib/libelf.a $(PTHREAD_LIBS)
-   DESTDIR=/usr
-else
 ifeq ($(shell uname -s), Darwin)
-   CFLAGS+=-I/usr/local/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64
-   LIBS=-L/usr/local/lib -L. -lelf -lpthread
-else
-ifeq ($(shell uname -s), SunOS)
-   CFLAGS+=-I/usr/local/include -DINADDR_NONE=0xFFFFFFFF \
-	-I /opt/csw/include -DSUNOS
-   LIBS=-L/usr/local/lib -L. -lelf -lpthread -L/opt/csw/lib \
-	-lsocket -lnsl -lresolv
-   PCAP_LIB=/opt/csw/lib/libpcap.a
-else
-ifeq ($(shell uname -o), Cygwin)
-   CFLAGS+=-I/usr/local/include -I/usr/local/include/libelf -DCYGWIN \
-	-D_FILE_OFFSET_BITS=64
-   LIBS=-L/usr/local/lib -L. -lelf -lpthread
-   PCAP_LIB=-lpacket -lwpcap
+   CFLAGS+=-I$(PREFIX)/include/libelf -I$(PREFIX)/include -mdynamic-no-pic -D_FILE_OFFSET_BITS=64
+   LIBS=-L$(PREFIX)/lib -L. -lelf -lpthread
 else
-   CFLAGS+=-I/usr/include/libelf -D_FILE_OFFSET_BITS=64
-   LIBS=-L. /usr/lib/libelf.a -lpthread
-endif
-endif
-endif
-endif
+   CFLAGS+=-I$(PREFIX)/include/libelf -D_FILE_OFFSET_BITS=64
+   LIBS=-L. $(PREFIX)/lib/libelf.a -lpthread
 endif
 
 PROG=dynamips$(BIN_EXT)
@@ -231,12 +200,12 @@
 
 install: $(PROG) nvram_export
 	@echo "Installing"
-	install -d $(DESTDIR)/bin $(DESTDIR)/man/man1 $(DESTDIR)/man/man7 $(DESTDIR)/etc
-	install dynamips nvram_export   $(DESTDIR)/bin
-	install -m644 dynamips.1        $(DESTDIR)/man/man1
-	install -m644 nvram_export.1    $(DESTDIR)/man/man1
-	install -m644 hypervisor_mode.7 $(DESTDIR)/man/man7
-# install -m644 example         $(DESTDIR)/etc/dynamips
+	install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/share/man/man7 $(DESTDIR)$(PREFIX)/etc
+	install dynamips nvram_export   $(DESTDIR)$(PREFIX)/bin
+	install -m644 dynamips.1        $(DESTDIR)$(PREFIX)/share/man/man1
+	install -m644 nvram_export.1    $(DESTDIR)$(PREFIX)/share/man/man1
+	install -m644 hypervisor_mode.7 $(DESTDIR)$(PREFIX)/share/man/man7
+# install -m644 example         $(DESTDIR)$(PREFIX)/etc/dynamips
 
 
 .PHONY: clean
