Remove build warnings

* `link_directories` was causing a linker warning on mac
* moved temporary variable only used in an assert