remove hardcoded paths and fix library linking