Updated build script with dynamic target config