target-needs-ref: fix previous commit

The condition to raise an error needed to be reverse.

Signed-off-by: Jan Dvořák <mordae@anilinux.org>