move -lgetopt to end of link command