Fix initialization cycle in `target_config`
There is an initialization cycle in `target_config`. Details in the final commit. The previous commits are precursors that support the changes in the final commit.
r? @nikic
cc @cuviper @RalfJung @Zalathar @Patryk27