Attempt to support static linking
Fix bug in contaminant rebuild