Place sliced apples in a large bowl; sprinkle with lemon juice, if desired. In a small bowl, mix together white sugar, 2 tablespoons flour, cinnamon, and nutmeg. Sprinkle mixture over apples and toss until apple slices are evenly coated. Stir in raisins and walnuts (optional). Transfer mixture into pastry shell.
In a small bowl ,mix together 1/2 cup flour and brown sugar. Cut in butter or margarine until mixture is crumbly. Sprinkle mixture over apple filling. Cover top loosely with aluminum foil.
Bake in preheated oven for 25 minutes. Remove foil and bake an additional 25 to 30 minutes, until top is golden brown and filling is bubbly. Cool on a wire rack.