Update CMakeLists.txt

Change library type to shared and add install routines.