added CMake option GMX_PREFER_STATIC_LIBS (also fixes bug #541)