diff -ru gpaw-0.9.0.8965.orig/customize.py gpaw-0.9.0.8965/customize.py
--- gpaw-0.9.0.8965.orig/customize.py	2012-03-07 15:17:58.000000000 +0100
+++ gpaw-0.9.0.8965/customize.py	2012-08-30 14:05:59.285776631 +0200
@@ -7,11 +7,13 @@
 #To append use the form
 #     libraries += ['somelib','otherlib']
 
+import os
+
 #compiler = 'mpcc'
-#libraries = []
+libraries = [libfile[3:-2] for libfile in os.getenv('LAPACK_MT_STATIC_LIBS').split(',')]
 #libraries += []
 
-#library_dirs = []
+library_dirs = os.getenv('LD_LIBRARY_PATH').split(':')
 #library_dirs += []
 
 #include_dirs = []
