Change LIBRARY_FLAGS to LIBS and LIBRARY_PATHS to LIB_PATHS, add LINK_FLAGS variable.