cmake: Make the installation paths customizable

Allow specifying the installation prefix on the command-line
via e.g. `cmake -DCMAKE_INSTALL_PREFIX=/usr/local`.

Add install() commands so that "make DESTDIR=/tmp install"
works as expected with a custom installation prefix.

Allow the library directory basename to be overridden so that
custom installation layouts, such as $prefix/lib64 (fedora),
can be supported by passing -DCMAKE_LIBDIR_BASE=lib64 to cmake.