Combine the flour, margarine, sugar and salt in a large bowl.
Work with your fingers, gathering and crumbling, until you have a crumbly mixture, about the size of peas.
Slowly add cold water in small amounts, gently incorporating it by hand.
As soon as the dough comes together in a ball, wrap in plastic wrap and chill for 30 minutes.
For the filling:
Mix the goat cheese, heavy cream, egg, sugar, flour, salt and basil together in a bowl. Add the blueberries and mix to the desired texture.
For the topping:
Mix the almonds, sugar and margarine in a bowl; set aside.
Preheat the oven to 350 degrees F.
Roll out the dough and place it in a 10-inch pie pan. Pour the filling into the crust and sprinkle over the topping. Bake, rotating halfway through, for 25 minutes.