Fix wrong definition of TARGET for plugins with dependencies

Change-Id: Ie0932f3d55e2b7c82ebcd6585fdac3f977f875f3
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>