THRIFT-506. Allow Thrift to be built without the C++ library

Currently, this is only possible by explicitly passing --without-cpp.
It might be better to name it --without-cxx, but it is probably more
important to keep consistency with the "cpp" generator and "lib/cpp".

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991248 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/Makefile.am b/lib/Makefile.am
index c949dc0..56c4e97 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -17,8 +17,11 @@
 # under the License.
 #
 
-SUBDIRS = \
-  cpp
+SUBDIRS =
+
+if WITH_CPP
+SUBDIRS += cpp
+endif
 
 if WITH_MONO
 SUBDIRS += csharp