Most teams that have endured are backed by large companies that can absorb losses, but I have never seen any books from any teams.
They'll get about $80 million back on that from prize money (it's more like $100 million if you win).
Then there's the sponsorship - for a large team about $300 million a year is reasonable.
The rest can often be found from elsewhere. McLaren had large funding from Daimler until recently (when they received a $40 million fine Daimler paid) - Ferrari have a lot of their own money. F1 drives car sales, and the technology from F1 can be pulled back into the road cars - just look at McLaren's new models..