--- ATLAS/makes/Make.lib	2008-02-27 23:42:56.000000000 -0500
+++ ATLAS/makes/Make.lib.new	2008-02-28 00:49:08.000000000 -0500
@@ -8,8 +8,11 @@
 CDYNlibs = liblapack.so libcblas.so libatlas.so 
 CPTDYNlibs = liblapack.so libptcblas.so libatlas.so 
 
 VER=3.8.0
+MAJOR_VER=3
+LD=gcc
+
 tarnam = atlas$(VER)_$(ARCH)
 tar : tarfile
 tarfile : $(tarnam).tgz
 $(tarnam).tgz :
@@ -32,61 +35,63 @@
 	mv $(tarnam).tar.gz $(tarnam).tgz
 
 ptshared :
 	- rm -f libatlas.so liblapack.so
-	$(MAKE) libatlas.so liblapack.so libptf77blas.so libf77blas.so \
-                libptcblas.so libcblas.so liblapack.so
+	$(MAKE) libatlas.so libcblas.so liblapack.so libptf77blas.so \
+                libf77blas.so libptcblas.so
 shared :
 	- rm -f libatlas.so liblapack.so
-	$(MAKE) libatlas.so liblapack.so libf77blas.so libcblas.so liblapack.so
+	$(MAKE) libatlas.so libcblas.so liblapack.so libf77blas.so
 cptshared :
 	- rm -f libatlas.so libclapack.so
 	$(MAKE) libatlas.so libclapack.so libptcblas.so libcblas.so
 cshared :
 	- rm -f libatlas.so libclapack.so
 	$(MAKE) libatlas.so libclapack.so libcblas.so
 
 libatlas.so : libatlas.a
-	ld $(LDFLAGS) -shared -soname libatlas.so -o libatlas.so \
-        --whole-archive libatlas.a --no-whole-archive -lc $(LIBS)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,libatlas.so.$(MAJOR_VER) -o libatlas.so \
+        -Wl,--whole-archive,libatlas.a -Wl,--no-whole-archive,-lc,-lpthread,-lm
 liblapack.so : liblapack.a
-	ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive \
-           liblapack.a --no-whole-archive $(F77SYSLIB)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,$@.$(MAJOR_VER) -o $@ \
+        -Wl,--whole-archive,liblapack.a -Wl,--no-whole-archive,-lgfortran,-L.,-lcblas
 libclapack.so : libclapack.a
-	ld $(LDFLAGS) -shared -soname liblapack.so -o liblapack.so \
-           --whole-archive libclapack.a
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,liblapack.so.$(MAJOR_VER) -o liblapack.so \
+           -Wl,--whole-archive,libclapack.a
 libptf77blas.so : libptf77blas.a
-	ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive libptf77blas.a \
-           --no-whole-archive $(F77SYSLIB)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,$@.$(MAJOR_VER) -o $@ \
+        -Wl,--whole-archive,libptf77blas.a -Wl,--no-whole-archive,-lgfortran
 libf77blas.so : libf77blas.a
-	ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive libf77blas.a \
-           --no-whole-archive $(F77SYSLIB)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,$@.$(MAJOR_VER) -o $@ \
+        -Wl,--whole-archive,libf77blas.a -Wl,--no-whole-archive,-lgfortran
 libptcblas.so : libptcblas.a
-	ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive libptcblas.a
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,$@.$(MAJOR_VER) -o $@ \
+        -Wl,--whole-archive,libptcblas.a
 libcblas.so : libcblas.a
-	ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive libcblas.a
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,$@.$(MAJOR_VER) -o $@ \
+        -Wl,--whole-archive,libcblas.a -Wl,--no-whole-archive,-lc
 #
 # Builds one shared lib from all ATLAS files
 #
 fat_ptshared :                              # threaded target
-	ld $(LDFLAGS) -shared -soname libatlas.so -o libatlas.so \
-        --whole-archive liblapack.a libptf77blas.a libptcblas.a libatlas.a \
-           --no-whole-archive -lc $(F77SYSLIB) $(LIBS)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,libatlas.so.$(MAJOR_VER) -o libatlas.so \
+        -Wl,--whole-archive,liblapack.a,libptf77blas.a,libptcblas.a,libatlas.a \
+           -Wl,--no-whole-archive,-lc,-lgfortran,-lpthread,-lm
 fat_shared :                                # unthreaded target
-	ld $(LDFLAGS) -shared -soname libatlas.so -o libatlas.so \
-        --whole-archive liblapack.a libf77blas.a libcblas.a libatlas.a \
-           --no-whole-archive -lc $(F77SYSLIB) $(LIBS)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,libatlas.so.$(MAJOR_VER) -o libatlas.so \
+        -Wl,--whole-archive,liblapack.a,libf77blas.a,libcblas.a,libatlas.a \
+           -Wl,--no-whole-archive,-lc,-lgfortran,-lpthread,-lm
 #
 # Builds shared lib, not include fortran codes from LAPACK
 #
 fat_cptshared : libclapack.a                # threaded target
-	ld $(LDFLAGS) -shared -soname libcatlas.so -o libcatlas.so \
-        --whole-archive libclapack.a libptcblas.a libatlas.a \
-        --no-whole-archive -lc $(LIBS)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,libcatlas.so.$(MAJOR_VER) -o libcatlas.so \
+        -Wl,--whole-archive,libclapack.a,libptcblas.a,libatlas.a \
+        -Wl,--no-whole-archive,-lc,-lpthread,-lm
 fat_cshared : libclapack.a                  # unthreaded target
-	ld $(LDFLAGS) -shared -soname libcatlas.so -o libcatlas.so \
-        --whole-archive libclapack.a libcblas.a libatlas.a \
-        --no-whole-archive -lc $(LIBS)
+	$(LD) $(LDFLAGS) -shared -Wl,-soname,libcatlas.so.$(MAJOR_VER) -o libcatlas.so \
+        -Wl,--whole-archive,libclapack.a,libcblas.a,libatlas.a \
+        -Wl,--no-whole-archive,-lc,-lpthread,-lm
 
 libclapack.a : liblapack.a
 	rm -rf clapack libclapack.a
 	mkdir clapack
