Preheat oven to 350 degrees. Spray a 9x13x2 baking pan (or 4 quart casserole) with cooking spray.
Mix flour, brown sugar and salt in a microwavable 4 cup measuring cup.
Add syrup from yam cans so that the measuring cup contains about 2 1/2 cups. (You'll add about 2 cups of syrup, but some of the sugar and flour dissolves.) Stir.
Add butter, sliced.
Microwave, stirring frequently, until sauce is thick, but still pourable. This step took me about 10 minutes. I start with 90 seconds, then stir every 30 or 20 seconds. If it gets too thick, add water and stir.
Place yams in sprayed casserole. Pour sauce over yams. Bake until the sauce starts to bubble, about 25 minutes.
Top with marshmallows and return to the oven to brown, about 10 minutes.