gbuild: LinkTarget: improve gb_LinkTarget__get_headers_check

Can actually error out early in some cases of partial build with missing
deps from other modules; probably better than trying to build
(Static)Library with bogus vars.

Change-Id: I4e2cbd42d3c84b9bc87607d263f3d80ba7914302