Just guessing here but if it works better when the troller is on then it may be something loose. Engaging the trolling motor could be applying pressure, vibrations, or some such that makes it work whereas it was not. I would still start with examining the connection. Is it possible that the wire was kinked and broken?