Mix the flour, salt and sugar in a bowl. Add the margarine and rub together by hand to form an even, crumbly mixture. Add the water, mix quickly to create a soft dough.
Transfer the dough to the prepared tin and flatten by hand, creating a rim approx. 2 cm high around the edge. Chill the dough until ready to use.
Cook the squash in salted water (with the lid on) for approx. 30 mins. Drain the squash well, leave to cool, mash into a puree. In a small pan, combine the coconut milk with the agar-agar and cornflour, bring to the boil, simmer for approx. 2 mins., allow to cool slightly. Using a blender, puree the coconut milk with all the other ingredients up to and including the cardamom. Prick the pastry base with a fork and cover with the pie filling.
Bake for approx. 45 mins. in the lower third of an oven preheated to 175°C. Remove the pie from the oven, leave to cool. Cover and chill for approx. 2 hrs.