This was possible because of time travel.
At some point, the young Melody Pond (later known as River Song) was taken back in time by the Silence to an abandoned orphanage in late 1960s Florida. She escaped from the Silence, made her way to New York, which took her about six months, & regenerated there ("The Impossible Astronaut"/"Day of the Moon"). She subsequently (we don't know how) located her parents, Amy & Rory, who were then children in Leadworth. She went to live in Leadworth. At that time, she appeared to be about the same age as them & used the name "Mels" (short for Melody). She grew up with them, attending the same school(s) & becoming their friend ("Let's Kill Hitler").