Only add option for shared libraries once

The way the test was done previously, it was added for *every* option
after `--enable-shared`, not only that one.
Merge pull request #417 from rolk/417_shared

Only add option for shared libraries once