Some linkers are very sensitive to library ordering so the order in which LIBS is generated is important to reliable detection of libraries.
This macro will fail to detect that library is present, because linking the test program will always fail with unresolved symbols.