A Turkish man whose house and store were damaged in the August earthquake got a lucky break this week when he went back in to assess the damage – and found a winning lottery ticket worth $356,000.

A relieved Ramiz Uzum said the winnings couldn’t have come at a better time.

“After the earthquake, we lived in a park, inside a tent we made ourselves,” said the father of three.

Uzum credited his wife for making him go back into the house to recover some belongings.

His home and corner store in Istanbul’s Avcilar district were badly damaged by the Aug. 17 tremor, which killed more than 17,000 people and left hundreds of thousands with no place to live.

Besides rebuilding a house and buying a new car, Uzum promised to use the 166.5 billion Turkish lira to help other victims of the quake.

About 500,000 Turks remain homeless, living in small canvas tents without running water.

“We are dealing daily with rain and chills. There is a feeling we could get sick at any moment,” said Ilyas Sert, who lives in a tepee-style canvas tent with his wife and baby in a campsite near Adapazari.

Autumn rains have turned many of the hundreds of camps throughout the Mediterranean country into seas of mud, compounding the suffering.

The race is on to build prefabricated houses before the winter cold begins to bite, but officials fear the homes won”t be ready.

“We are working around the clock. But what we really need at this point is time,” Deputy Gov. Alparslan Kavaklioglu said. Behind him, a large city map is dotted with brightly colored flags, each marking the site of a tent city.

Nearly 40,000 people have been living in the tents for eight weeks since the quake tore through the 1980s industrial boomtown.

This weekend, 350 families are due to move into the first batch of prefab houses, built on swaths of land outside Adapazari. Priority is being given to those with children.

“The plan is that everyone be moved into prefabricated houses by Nov. 30,” said Kavaklioglu. But the late start and the pace of work suggest there will be delays.

Ankara has ordered gas stoves to heat the tents in the interim, but residents are wary.