fix deduplicate libraries (fix #558)