GM will invest $500 million in Lyft and take a seat on the ride-sharing startup’s board of directors. It will also become a preferred provider of cars for short-term use to Lyft drivers.