Output should now be complete

- Added pthread_join call, to prevent the exit of the programm
before all results are written back