  prefix		= @prefix@
  exec_prefix	= @exec_prefix@
  DESTDIR		= 
-@@ -41,7 +42,7 @@
+@@ -34,14 +35,14 @@
+ FC =		@FC@
+ LDFLAGS =	$(CFLAGS)
+ DEFS =		@DEFS@
+-LIBS =		@LIBS@
++LIBS =		@LIBS@ -lnosys
+ FLEX =		flex
+ BISON =		bison
+ 
  SHLIB_LD =	@SHLIB_LD@
  SHLIB_SUFFIX =	@SHLIB_SUFFIX@
  

 		$(CC) -c $(CFLAGS) $(DEFS) $<
 
 
@@ -97,7 +98,7 @@
 		if [ -f libcfitsio${SHLIB_SUFFIX} ]; then \
 			/bin/mv libcfitsio${SHLIB_SUFFIX} ${CFITSIO_LIB}; \
 		fi; \
-		/bin/cp fitsio.h fitsio2.h longnam.h drvrsmem.h ${CFITSIO_INCLUDE}/; \
+		/bin/cp $(srcdir)/fitsio.h $(srcdir)/fitsio2.h $(srcdir)/longnam.h $(srcdir)/drvrsmem.h ${CFITSIO_INCLUDE}/; \
		/bin/cp cfitsio.pc ${CFITSIO_LIB}/pkgconfig
 
 smem:		smem.o libcfitsio.a ${OBJECTS}
 		${CC} $(CFLAGS) $(DEFS) -o smem smem.o -L. -lcfitsio -lm

diff -u cfitsio/Makefile.in cfitsio.new/Makefile.in
--- cfitsio/Makefile.in	2011-01-10 09:07:02.000000000 -0800
+++ cfitsio.new/Makefile.in	2011-02-08 15:48:16.947612000 -0800
@@ -18,6 +18,7 @@
 # testprog targets. See also changes and comments in configure.in
 #
