Before Elon Musk talked to Google about buying Tesla, the car maker admitted that it was running out of money