Use multithreading when filling a newly created Monge matrix.
Bugfix: we had degenerated matrices in some cases.
Add preprocessor macros for the multithreaded matrix generation.