---- cfitsio/Makefile.in	2009-07-14 13:40:37.000000000 -0700
-+++ cfitsio.new/Makefile.in	2011-01-13 11:36:17.241181415 -0800
+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
  #

 		$(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

 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 DESTDIR		= 
@@ -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@
 
