Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES"
This reverts !1620 (merged). The behavior change can affect checks in existing projects that don't expect the behavior. Introducing the behavior again will require a policy.
Fixes: #17874 (closed)
Issue: #9514 (closed)