You could make use the pattern stem automatic variable in lines five and six to replace
$(patsubst %.stdout,%.stderr,$@)
with $*.stderr $(patsubst %.stdout,%.stderr,$@)
with $*.stderrNo comments yet.