diff -Nurd cfitsio-4.3.0.orig/Makefile.in cfitsio-4.3.0/Makefile.in
--- cfitsio-4.3.0.orig/Makefile.in	2022-11-15 20:29:16.000000000 -0500
+++ cfitsio-4.3.0/Makefile.in	2023-10-10 23:56:14.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/rm -f ${CFITSIO_LIB}/$$lib"; \
@@ -141,32 +141,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}
 
 # Tested with bison 3.8 and flex 2.6.4
 eval:		# Rebuild eval_* files from flex/bison source
diff -Nurd cfitsio-4.3.0.orig/configure cfitsio-4.3.0/configure
--- cfitsio-4.3.0.orig/configure	2023-07-23 22:59:25.000000000 -0400
+++ cfitsio-4.3.0/configure	2023-10-11 00:20:15.000000000 -0400
@@ -3994,7 +3994,6 @@
 
 #-------------------------------------------------------------------------------
 
-LDFLAGS="$CFLAGS"
 LDFLAGS_BIN="$LDFLAGS"
 
 if test "x$FC" = "xnone" ; then
@@ -4352,7 +4351,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):
@@ -4538,16 +4537,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"
     ;;
@@ -4601,7 +4591,6 @@
 CURL_LIB_PATH=""
 if test "x$ADD_CURL" = xyes; then
   # Use curl-config to get compiler & linker flags, if available.
-  # (and prefer /usr/bin/curl-config)
   # Extract the first word of "curl-config", so it can be a program name with args.
 set dummy curl-config; ac_word=$2
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4616,7 +4605,7 @@
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /usr/bin$PATH_SEPARATOR$PATH
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   case $as_dir in #(((
@@ -4653,12 +4642,6 @@
     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 cygwin` -ne 0 -o `echo $host | grep -c mingw32` -ne 0; then
           LIBS="$CURL_LIB $LIBS"
       fi
