cppcheck: Fix build with custom rules

The HAVE_RULES variable is used to control whether cppcheck is built
with support for custom rules. The readme says to use HAVE_RULES=yes
to enable custom rules.

Closes #18763.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>