Improved CMake files

* Add support for static library
* Add INSTALL_LIB_DIR variable to control lib destination