Index: ThirdParty/mpqc_open/src/lib/chemistry/cca/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/cca/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/cca/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -82,3 +82,4 @@
 #nodist_libSCcca_libinclude_HEADERS = $(top_builddir)/src/lib/scconfig.h
 
-
+CCALIBS = \
+	libSCcca.la
Index: ThirdParty/mpqc_open/src/lib/chemistry/molecule/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/molecule/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/molecule/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -90,7 +90,5 @@
 
 MOLECULELIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCmolecule.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCgroup.la libSCrender.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 moltest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/basis/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/basis/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/basis/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -56,5 +56,5 @@
 libSCbasis_la_CPPFLAGS = $(AM_CPPFLAGS)
 libSCbasis_la_LDFLAGS = $(AM_LDFLAGS)
-libSCbasis_la_LIBADD =
+libSCbasis_la_LIBADD = $(FLIBS)
 
 nobase_libSCbasis_la_include_HEADERS = ${LIBSCBASISHEADERS}
@@ -99,7 +99,5 @@
 
 BASISLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCbasis.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCintv3.la libSCoint3.la libSCbasis.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCrender.la libSCscmat.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 btest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/cints/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/cints/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/cints/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -91,7 +91,5 @@
 
 CINTSLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCcints.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCcints.la libSCintv3.la libSCbasis.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCrender.la libSCscmat.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la libSCoint3.la
 
 cintstest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/dft/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/dft/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/dft/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -4,4 +4,5 @@
 	chemistry/qc/dft/hsosks.cc \
 	chemistry/qc/dft/integrator.cc \
+	chemistry/qc/dft/lebedev.c \
 	chemistry/qc/dft/tmplinst.cc \
 	chemistry/qc/dft/uks.cc
@@ -67,7 +68,5 @@
 
 DFTLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCdft.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCdft.la libSCscf.la libSCwfn.la libSCsolvent.la libSCintv3.la libSCbasis.la libSCoint3.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCgroup.la libSCrender.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 dfttest_SOURCES = \
@@ -77,6 +76,9 @@
 
 lebedev_SOURCES = \
-	chemistry/qc/dft/lebedev.cc
+	chemistry/qc/dft/lebedev.c
+lebedev_CPPFLAGS = \
+	$(AM_CPPFLAGS) -DDEFINE_MAIN
 lebedev_LDADD = \
-        $(DFTLIBS)
+        $(DFTLIBS) \
+	-lm
 
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -58,3 +58,4 @@
 #nodist_libSCintcca_libinclude_HEADERS = $(top_builddir)/src/lib/scconfig.h
 
-
+INTLIBS = \
+	libSCintcca.la libSCintv3.la libSCbasis.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCrender.la libSCscmat.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la libSCoint3.la cca/libSCchemistry.la
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -86,7 +86,5 @@
 
 INTV3LIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCintv3.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCintv3.la libSCbasis.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCrender.la libSCscmat.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la libSCoint3.la
 
 fjttest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/inttest.cc
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/inttest.cc	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intv3/inttest.cc	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -132,5 +132,5 @@
 
   Ref<KeyVal> pkv(new ParsedKeyVal(infile));
-  Ref<KeyVal> tkeyval(new PrefixKeyVal(":test", pkv));
+  Ref<KeyVal> tkeyval(new PrefixKeyVal(pkv, ":test"));
 
   Ref<GaussianBasisSet> basis = require_dynamic_cast<GaussianBasisSet*>(
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/mbpt/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/mbpt/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/mbpt/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -74,7 +74,5 @@
 
 MBPTLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCmbpt.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCmbpt.la libSCscf.la libSCdft.la libSCwfn.la libSCsolvent.la libSCintv3.la libSCbasis.la libSCoint3.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCrender.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 mbpttest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/mbptr12/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/mbptr12/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/mbptr12/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -124,7 +124,10 @@
 
 MBPTR12LIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCmbptr12.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCmbptr12.la \
+	libSCmbpt.la libSCscf.la libSCdft.la libSCwfn.la libSCsolvent.la libSCintv3.la libSCbasis.la libSCoint3.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCrender.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
+
+# should come right after libSCmbptr12.la if cints compiled
+#	libSCcints.la \
+#
 
 mbptr12test_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/oint3/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/oint3/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/oint3/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -153,3 +153,5 @@
 #nodist_libSCoint3_libinclude_HEADERS = $(top_builddir)/src/lib/scconfig.h
 
+OINT3LIBS = \
+	libSCoint3.la
 
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/psi/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/psi/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/psi/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -60,7 +60,5 @@
 
 PSILIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCpsi.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCpsi.la libSCdft.la libSCscf.la libSCwfn.la libSCsolvent.la libSCintv3.la libSCbasis.la libSCoint3.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCgroup.la libSCrender.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 psitest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/scf/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/scf/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/scf/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -93,7 +93,5 @@
 
 SCFLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCscf.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCdft.la libSCscf.la libSCwfn.la libSCsolvent.la libSCintv3.la libSCbasis.la libSCoint3.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCrender.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 scftest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/wfn/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/wfn/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/wfn/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -70,7 +70,5 @@
 
 WFNLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCwfn.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCdft.la libSCscf.la libSCwfn.la libSCsolvent.la libSCintv3.la libSCbasis.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCrender.la libSCscmat.la libSCgroup.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la libSCoint3.la
 
 wfntest_SOURCES = \
Index: ThirdParty/mpqc_open/src/lib/chemistry/solvent/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/solvent/Makefile.am	(revision 12add27119b06cdfc32fbb4480b0402bb3b9ec43)
+++ ThirdParty/mpqc_open/src/lib/chemistry/solvent/Makefile.am	(revision 6b1a6a74f7e57bc0b3f4e590d1f6ea04703c9ab0)
@@ -54,7 +54,5 @@
 
 SOLVENTLIBS = \
-        libSCkeyval.la \
-        libSCgroup.la libSCwfn.la libSCclass.la \
-        libSCcontainer.la libSCref.la libSCmisc.la
+	libSCsolvent.la libSCmolecule.la libSCisosurf.la libSCoptimize.la libSCsymmetry.la libSCscmat.la libSCgroup.la libSCrender.la libSCmisc.la libSCstate.la libSCkeyval.la libSCclass.la libSCcontainer.la libSCref.la
 
 bemtest_SOURCES = \
