I haven't had this problem myself, but I understand enough about thermocouples to offer a few suggestions:
1. DO NOT get tempted to replace the wires... a thermocouple plus its leads function as a single unit and what ISSPRO has joined together let no man put asunder. If the leads actually are bad, you'll need to replace the thermocouple + leads as a unit.
2. One possibility is corrosion/dirt at connectors, so check this. Thermocouples are very sensitive to this. Clean with electronic contact cleaner if needed, then cover with heat-shrink tubing.
3. Other possibility is your gauge is bad... lots of delicate mechanicals in there. Can you borrow a friend's to swap in for testing purposes?
4. Get two little jars with some ATF in them. Put one in the freezer, put the other someplace warm (in front of a heater vent?). Disconnect the leads from the gauge and the sender from the transmission. Slap a digital voltmeter on the ends of the leads, stick the sender in the hot ATF and the cold ATF. There are tables of what voltages the sender should be putting out at these different temps, but I'm sorry I don't have any (maybe another member can point us to a source?). At any rate, you want to see steady (and different) voltages under these two conditions. If you do, then the sender is probably good and (if the connections were clean) the gauge is probably blown. There's actually not a lot that can go wrong with the sender itself unless you smash it to bits or break a lead.