The vast majority of the weapons used in the Mexican drug conflict are illegal to sell in the US except to persons holding a difficult to obtain, very expensive licence. A "true" AK-47 or M16 is a five-figure plus gun, although once you own one such weapon, it is much cheaper to obtain more.
The weapons commonly used are, however, of the same types used by Mexican army and police units. Note that the sum total of the evidence for the "majority" of cartel arms being US sourced is claims by the Mexican president, someone who has a vested interest in securing foreign blame for the problem. There are certainly arms crossing the border southward, just as there are drugs and immigrants crossing it. But there is zero evidence to suggest those kind of quantities.
As for legalization as a panacea, it won't work for most drugs. When heroin, cocaine, and the like were legal, addiction rates were several times higher than they are today, and regulations are an easily bypassed joke. Certainly, legalizing marijuana and resisting calls to re-ban alcohol have merit, because the former is neither addictive or dangerous, and the dangers of the latter are clearly less than the social cost of control attempts. There may be other "soft" drugs that fit in this category. But you should never be able to legally buy crystal meth or crack cocaine under any circumstances.
The mexican drug war is ultimately caused by a weak government who's opponents have nigh-unlimited supplies of cash and are completely immune to prosecution through bribed cops and judges. If, for example, joint US-Mexican law enforcement with a bodyguard (a battalion of Marines, for example) were to arrest them and extradite to the US (the courts of which are mostly out of the reach of the cartels), there is a very good chance that this could turn the tide. Sovereignity issues prevent this, however.