improve volknnsearch by supporting passing in of libraries