Fix LD flags, and check for libraries at configure
Share a record for the request. Don't look up multiple times.