Heat oven to 350 degrees. Cook onion and green pepper in margarine until tender. Stir in flour and pepper. Add milk and bring to a boil, stirring constantly. Reduce heat and add cheese and mayonnaise; stir until cheese melts. Add potatoes and ham; put into greased casserole dish. Bake for 30 minutes.