Remove debug/optimization build options and instead set proper debug/release cmake flags.
Do not attempt to find DL library on MinGW.
Use memset instead of bzero.