diff -Nurd cfitsio-4.1.0.orig/Makefile.in cfitsio-4.1.0/Makefile.in
--- cfitsio-4.1.0.orig/Makefile.in	2021-10-15 15:08:49.000000000 -0400
+++ cfitsio-4.1.0/Makefile.in	2023-10-11 00:21:36.000000000 -0400
@@ -93,7 +93,7 @@
 all-nofitsio:
 		${MAKE} stand_alone "FITSIO_SRC="
 
-stand_alone:	lib${PACKAGE}.a shared
+stand_alone:	shared
 
 lib${PACKAGE}.a:	${OBJECTS}
 		${ARCHIVE} $@ ${OBJECTS}; \
@@ -108,8 +108,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,32 +139,32 @@
 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}
 
 testf77:	testf77.o lib${PACKAGE}.a ${OBJECTS}
-		${FC} ${LDFLAGS_BIN} -o $@ ${@}.o -L. -l${PACKAGE} -lm ${LIBS}
+		${FC} ${LDFLAGS_BIN} -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-4.1.0.orig/configure cfitsio-4.1.0/configure
--- cfitsio-4.1.0.orig/configure	2022-02-15 14:51:12.000000000 -0500
+++ cfitsio-4.1.0/configure	2023-10-11 00:22:06.000000000 -0400
@@ -4644,7 +4644,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
@@ -5002,7 +5001,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):
@@ -5188,16 +5187,7 @@
     SHLIB_SUFFIX=".dylib"
     CFITSIO_SHLIB="lib\${PACKAGE}.\${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}.\${CFITSIO_MICRO}\${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}.\${CFITSIO_MICRO}"
-            ;;
-        *)
-            # 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}.\${CFITSIO_MICRO}"
-            ;;
-    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}.\${CFITSIO_MICRO}"
 
     lhea_shlib_cflags="-fPIC -fno-common"
     ;;
@@ -5299,12 +5289,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
