[build] fix configure with complex enviroments

- add ldflags
- fix multivalued options like --cflags="-m64 -I/include/extra" 
(argument should not parse in subfunction)