Create target directories if they don't exist.