There are a couple of words that would fit a building or construct that could be either connected or not.
Building extension - this is by definition connected to the main building.
Building annex (see definition noun 1) - this can be connected to the main building but not necessarily (an attic would be connected, an outhouse or a barn probably wouldn't).
Building auxiliary would also work.
To my knowledge there is no word that means that it was formerly non connected, but became connected later on, so I would say that "annex" does cover this particular case, without being the exact definition. An annex could also be a new building that was originally built by someone else but later on acquired.