fix dynamic build

via @aljex. Closes #46