kbuild: consistently decide when to rebuild a target