BUG: Fix support for builds in dirs with whitespace

Add escaping and quoting of dirs and enabled POSIX support in lexer.

Closes #4382.
Merge pull request #4421 from meltingwax/meltingwax/4382

BUG: Fix support for builds with directories that contain whitespace