Introduce missing -dynamic flag, fix targets from Makefile

This produces an executable that actually runs.