waf: remove some complexity in libraries management