fix case where library directory is prefix