Preheat oven to 375 degrees F (190 degrees C).
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. Toss until apples are evenly coated. Stir in raisins and walnuts if desired. Spoon 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. Cool on a wire rack.