To make the pastry, sift the flour and salt into a bowl. Make a well in the middle. Add the water and lemon juice and mix together, kneading quickly to a smooth dough. Wrap in cling film and allow to rest for 30 minutes. Meanwhile, place the block of butter between two large sheets of greaseproof paper or cling film and, using a rolling pin, flatten it out until it measures about 20 by 15cm, then return it to the fridge. On a lightly dusted surface roll out the pastry to about 25 by 45cm. Place the flattened butter in the middle of the pastry and fold the two ends in to cover the butter. Turn by 90 degrees and roll out to 25 by 45cm again. Then repeat: fold one third up and then the remaining third, turn by 90 degrees and roll out again. Wrap and place in the fridge to cool and rest for 30 minutes. Repeat the above process twice, and rest the pastry for 30 minutes before rolling it into the required shape.
Slice the onions very finely (using a mandolin if you have one). Heat the oil and add the onions. Fry briskly for 5 minutes, then add the wine, lardons and 2 sprigs of thyme. Reduce the heat and cook for 30 minutes, stirring frequently until the liquid evaporates.