Fixed a few syntax typos and did some preprocessor cleanup.
Changed the tap restart logic to be a little more clear.
Switched to static memory int for the thread return status to prevent a possible memory leak if the thread is terminated in an unorthodox way.
Fixed a configuration issue with x11 platforms not finding the correct source files.