update handling of library deduplication to support build configuration keywords in the whole process (fix #565)