configure: Add separate list for libraries and use where appropriate