configure.ac.in has: XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0]) though Makefile uses GTK+2 only when GTK+3 is not found. I guess this check should be made conditional to GTK+3 being not found.
Agreed, this will be fixed soon though because Gtk2 support will be dropped.
I think this particular issue has been fixed by https://git.xfce.org/apps/xfce4-taskmanager/commit/?id=13c78d9738ba3b65ba0432bdbe8986f2510d784f which reverted the logic, even if the gtk2 codepaths are still there. And note that depending on gtk2/gtk3 being chosen, the binary will be built against the corresponding version, so technically that was only a build dependency, not a runtime dependency..