fix library base path detection