fix linkage, build issues (via jwatte)