You think they didn't know how to build wells? They knew about wells and had them. They had developed basic irrigation too (redirecting the Nile). Water doesn't prevent them from collapsing as an empire.
BTW, yes, it's easy to lose information in those days. This was before the Internet, printing press, limited schooling, invention of cheap paper, etc. This was the period of the very first written language. All it takes is the sacking of one city to lose a large chunk of knowledge.
There's also the Dark Ages as an example.