diff -Nurd cfitsio-3.47.orig/Makefile.in cfitsio-3.47/Makefile.in
--- cfitsio-3.47.orig/Makefile.in	2019-05-08 11:34:50.000000000 -0400
+++ cfitsio-3.47/Makefile.in	2023-10-11 00:21:44.000000000 -0400
@@ -94,7 +94,7 @@
 all-nofitsio:
 		${MAKE} stand_alone "FITSIO_SRC="
 
-stand_alone:	lib${PACKAGE}.a shared
+stand_alone:	shared
 
 lib${PACKAGE}.a:	${OBJECTS}
 		${ARCHIVE} $@ ${OBJECTS}; \
@@ -109,8 +109,8 @@
 			ln -sf ${CFITSIO_SHLIB_SONAME} $@; \
 		fi
 
-install:	lib${PACKAGE}.a ${INSTALL_DIRS}
-		@for lib in lib${PACKAGE}.a lib${PACKAGE}${SHLIB_SUFFIX} \
+install:	${INSTALL_DIRS}
+		@for lib in lib${PACKAGE}${SHLIB_SUFFIX} \
 				${CFITSIO_SHLIB} ${CFITSIO_SHLIB_SONAME}; do \
 		    if [ -f $$lib ]; then \
 			echo "/bin/cp -a $$lib ${CFITSIO_LIB}"; \
@@ -139,29 +139,29 @@
 swapproc.o:	swapproc.c
 		${CC} -c ${CFLAGS} ${CPPFLAGS} ${SSE_FLAGS} ${DEFS} $<
 
-smem:		smem.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm
+smem:		smem.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o lib${PACKAGE}${SHLIB_SUFFIX} -lm
 
-testprog:	testprog.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
+testprog:	testprog.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
-fpack:		fpack.o fpackutil.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o -L. -l${PACKAGE} -lm ${LIBS}
+fpack:		fpack.o fpackutil.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
-funpack:	funpack.o fpackutil.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o -L. -l${PACKAGE} -lm ${LIBS}
+funpack:	funpack.o fpackutil.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o fpackutil.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
-fitscopy:	fitscopy.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
+fitscopy:	fitscopy.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
-speed:		speed.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
+speed:		speed.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
-imcopy:		imcopy.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
+imcopy:		imcopy.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
-cookbook:	cookbook.o lib${PACKAGE}.a ${OBJECTS}
-		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
+cookbook:	cookbook.o lib${PACKAGE}${SHLIB_SUFFIX} ${OBJECTS}
+		${CC} ${LDFLAGS_BIN} ${DEFS} -o $@ ${@}.o lib${PACKAGE}${SHLIB_SUFFIX} -lm ${LIBS}
 
 eval:		# Rebuild eval_* files from flex/bison source
 		${FLEX} -t eval.l > eval_l.c1
diff -Nurd cfitsio-3.47.orig/configure cfitsio-3.47/configure
--- cfitsio-3.47.orig/configure	2019-05-21 15:42:17.000000000 -0400
+++ cfitsio-3.47/configure	2023-10-11 00:21:56.000000000 -0400
@@ -4298,7 +4298,6 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-LDFLAGS="$CFLAGS"
 LDFLAGS_BIN="$LDFLAGS"
 
 if test "x$FC" = "xnone" ; then
@@ -4632,7 +4631,7 @@
 #                  CFLAGS="$CFLAGS $C_UNIV_SWITCH"
 #                fi
                 # LDFLAGS used by utilities:
-                LDFLAGS_BIN="$LDFLAGS_BIN -Wl,-rpath,\${CFITSIO_LIB}"
+#                LDFLAGS_BIN="$LDFLAGS_BIN -Wl,-rpath,\${CFITSIO_LIB}"
                 ;;
         esac
         # For large file support (but may break Absoft compilers):
@@ -4810,16 +4809,7 @@
     SHLIB_SUFFIX=".dylib"
     CFITSIO_SHLIB="lib\${PACKAGE}.\${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}\${SHLIB_SUFFIX}"
     CFITSIO_SHLIB_SONAME="lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX}"
-    case $host in
-        *darwin[56789]*)
-            SHLIB_LD="$CC -dynamiclib -install_name lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}"
-            ;;
-        *)
-            # Build 'Universal' binaries (i386 & x86_64 architectures) and
-            # use rpath token on Darwin 10.x or newer:
-            SHLIB_LD="$CC -dynamiclib $C_UNIV_SWITCH -headerpad_max_install_names -install_name @rpath/lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}"
-            ;;
-    esac
+    SHLIB_LD="$CC -dynamiclib -headerpad_max_install_names -install_name lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}"
 
     lhea_shlib_cflags="-fPIC -fno-common"
     ;;
@@ -4911,12 +4901,12 @@
     if test "x$CURL_LIB" != x; then
       LIBS_CURL="$CURL_LIB"
       # Mac OS: For third-party curl-config, acquire an rpath:
-      if test `echo $host | grep -c apple-darwin` -ne 0 -a `echo $CURL_LIB | grep -c "^\-L"` -gt 0; then
-        CURL_LIB_PATH=`echo ${CURL_LIB} | tr " " "\012" | grep "^\-L" | tr "\012" " " | sed 's:-L::' | sed 's: $::'`
-        if test "x$CURL_LIB_PATH" != x; then
-          LIBS_CURL="-Wl,-rpath,$CURL_LIB_PATH $CURL_LIB"
-        fi
-      fi
+#      if test `echo $host | grep -c apple-darwin` -ne 0 -a `echo $CURL_LIB | grep -c "^\-L"` -gt 0; then
+#        CURL_LIB_PATH=`echo ${CURL_LIB} | tr " " "\012" | grep "^\-L" | tr "\012" " " | sed 's:-L::' | sed 's: $::'`
+#        if test "x$CURL_LIB_PATH" != x; then
+#          LIBS_CURL="-Wl,-rpath,$CURL_LIB_PATH $CURL_LIB"
+#        fi
+#      fi
       if test `echo $host | grep -c cygwin` -ne 0 -o `echo $host | grep -c mingw32` -ne 0; then
           LIBS="$CURL_LIB $LIBS"
       fi
