Index: src/driver/cfa.cc
===================================================================
--- src/driver/cfa.cc	(revision 24f46714e3d84e39031ca86708b991a79da0e12a)
+++ src/driver/cfa.cc	(revision d78f4c0a7006a7fb3a7b1951c38dd55700bf285b)
@@ -231,11 +231,5 @@
 	} // if
 
-	string d;
-	if ( debug ) {
-		d = "-d";
-	} // if
-
 	// add the CFA include-library paths, which allow direct access to header files without directory qualification
-
 	args[nargs] = "-I" CFA_INCDIR;
 	nargs += 1;
@@ -249,11 +243,30 @@
 	nargs += 1;
 
+#ifdef HAVE_LIBCFA
 	if ( link ) {
+		#if ! defined(HAVE_LIBCFA_RELEASE)
+			if( !debug ) { 
+				cerr << "error: Option -nodebug is not available, libcfa was not installed." << endl;
+				exit( EXIT_FAILURE );
+				}
+		#endif
+		#if ! defined(HAVE_LIBCFA_DEBUG)
+			if( debug ) { 
+				cerr << "error: Option -debug is not available, libcfa-d was not installed." << endl;
+				exit( EXIT_FAILURE );
+				}
+		#endif
+
 		// include the cfa library in case it's needed
 		args[nargs] = "-L" CFA_LIBDIR;
 		nargs += 1;
-		args[nargs] = "-lcfa";
-		nargs += 1;
-	} // if
+		if( debug ) {
+			args[nargs] = "-lcfa-d";
+		} else {
+			args[nargs] = "-lcfa";
+		}
+		nargs += 1;
+	} // if
+#endif //HAVE_LIBCFA
 
 	// add the correct set of flags based on the type of compile this is
