add check target to Makefile
test: switch to using TextIOWrapper

This fixes the problem with sys.stdout.buffer
and encoding not beeing available.
This way we are able to catch output for a script run
including print_encoded() output.
However, this doesn't work with Python 2 yet.