core: main: fix TARGET_OUT for sub targets