diff --git a/clean_release.sh b/clean_release.sh
index acc65d0e6aaec81c5ada4862f13a5943a5d26bf3..f860a6550bfb9b5808897d6c2940020c84343421 100644
--- a/clean_release.sh
+++ b/clean_release.sh
@@ -20,3 +20,7 @@ rm amanda_sn_plot.pl binary_c-antiTZ  binary_c-Ba binary_c.orig binary_c-sn2014
 rm -rf faillist fails imfticks fionread
 rm *~ src/*~ src/*/*~
 clean-svn.pl
+
+svn rm novae*pdf
+svn rm novae*plt
+svn rm cemps
diff --git a/configure b/configure
index ca1c1ba15a1e1b4e8c4304b1c31da0651e3e7532..bd469ebba0eb85bdde65d2311e5a1eb3356d5ce4 100755
--- a/configure
+++ b/configure
@@ -462,9 +462,9 @@ sub secondary_variables
     if($cc =~ /^(?:gcc|clang)/)
     {
         # libraries we should include if we can
-	if((checklib('libbfd')=~/libbfd-(\d+\.\d+)/)[0] &&
+	if(checklib('libbfd') &&
 	   test_for_header_file('bfd.h'))
-	{
+           {
             $cflags .= ' -D__HAVE_LIBBFD__ ';
 	    $extralibs.= ' -lbfd ';
         }
@@ -1215,12 +1215,37 @@ sub stripversion
 
 sub checklib
 {
-    # simple library checker : beware unescaped grep
+    # simple library checking function :
+    # on error return '' (empty string)
+
+    # get the library name
     my $lib = shift;
-    my $r = `ldconfig -p |grep $lib`;
+    my $striplib = ($lib=~/lib(.*)/)[0];
+    my $r;
+    
+    # first try with ld because this is supposed to work on the mac
+    $r = `ld -l$striplib 2>\&1`; 
+    
+    # check for error string : if the library isn't found
+    # then return an empty
+    if($r=~/cannot find -l$striplib/ || 
+       $r=~/not found for -l$striplib/)
+    {
+        # library not found : return empty string
+        return '';
+    }
+
+    # find location using ld, return if found
+    $r = `ld --verbose -l$striplib 2>\&1`;
+    if($r=~/attempt to open (\S+lib$striplib.so) succeeded/)
+    {
+        return $1;
+    }
+    
+    # ld failed, try ldconfig
+    $r = `ldconfig -p |grep $lib`;
     $r=~s/^\s+//;
     $r=~s/\s+$//;
-
     return $r if($r ne '');
 
     # check in LIBRARY_PATH and LD_LIBRARY_PATH