Ninja backend: objects generated with custom_target can be linked

I tried to compile some OpenCL source into resources that would be linked into the main program. That didn't work out, because generated objects couldn't be linked. This patch fixes that for Ninja backend.