Merge pull request #1060 from jmaas/master

Multiple fixes
Minor changes to Makefile