Very easy:
# similar to %-n.png and %-p.png, but using frames i+2, i-2, i+3 and i-3
%-n2.png: %.ppm $$(call inc,%,2).ppm
$(FLOW) $^ $@
%-p2.png: %.ppm $$(call inc,%,-2).ppm
$(FLOW) $^ $@
%-n3.png: %.ppm $$(call inc,%,3).ppm
$(FLOW) $^ $@
%-p3.png: %.ppm $$(call inc,%,-3).ppm
$(FLOW) $^ $@
# average current frame with 3 warped frames before and 3 after
%-a33.png: %.ppm %-n.png %-p.png %-n2.png %-p2.png %-n3.png %-p3.png
convert -average $^ $@
=> make whatever_001234-a33.png (or jpg, since there is a rule that converts from png to jpg)