The letter M is derived from the PhoenicianMem, via the GreekMu (Μ, μ). Semitic Mem is most likely derived from a "Proto-Sinaitic" (Bronze Age) adoption of the "water" ideogram in Egyptian writing. The Egyptian sign had the acrophonic value /n/, from the Egyptian word for "water", nt; the adoption as the Semitic letter for /m/ was presumably also on acrophonic grounds, from the Semitic word for "water", *mā(y)-.
^See F. Simons, "Proto-Sinaitic — Progenitor of the Alphabet" Rosetta 9 (2011): Figure Two: "Representative selection of proto-Sinaitic characters with comparison to Egyptian hieroglyphs", (p. 38) Figure Three: "Chart of all early proto-Canaanite letters with comparison to proto-Sinaitic signs" (p. 39), Figure Four: "Representative selection of later proto-Canaanite letters with comparison to early proto-Canaanite and proto-Sinaitic signs" (p. 40). See also: Goldwasser (2010), following Albright (1966), "Schematic Table of Proto-Sinaitic Characters" (fig. 1).