Fix missing symbols in library.

As of CMake 2.8 one can build libraries using the OBJECT feature, so that
several libraries can be combined into one using only the add_library()
function. The POSITION_INDENPENDENT_CODE property needs to be set in case the
user wants shared libraries (-DBUILD_SHARED_LIBS=yes).