Flood myths are easy to account for. Humans --like many living things-- need water to live and thrive, so they would stay near sources of freshwater even when they were nomadic groups. The development of farming allowed for the establishment of communities that stayed in one place-- and that would have been near sources of freshwater.
Thus, floods would have been a common experience, and massive, catastrophic floods would have occurred now and then. These would have become a part of their tales and legends, with the usual exaggeration that comes with time. Later generations would only know the basics of these tales and would build their own mythologies around them, with gods and heroes and extraordinary outcomes.