cmake: Extract libraries' configuration to separate file

Extract code which checks for availability of different libraries
(eg. fuse) to a separate Libraries.cmake file.