cmake: fixes for libraries