SERVER-6514 Re-add support for building the C++ driver shared library

Primarily a backport of da8c0fa929eeb03dbe3fb0533874de31da0bc8c8, with
the following SERVER-6514 fixups patches from master rolled in as well:

680f0bf57260bf020cfaeb35598861c6b89524cb
48f8431210aba4de7d108852bc1d87267237d358